import {
  getHomeCasual,
  getHomeNav,
  getHomeShopList,
  getRecommendShopList,
  getSearchShopList
} from '../api'


export default {
  //1.1获取首页轮播图
  async reqHomeCasual({commit}){
    const result=await getHomeCasual();
    commit('setHomeCasual', result.message)
  },

  //1.2获取导航图
  async reqHomeNav({commit}){
    const result=await getHomeNav();
    commit('setHomeNav', result.message.data)
  },

  //1.3获取首页商品列表
  async reqHomeShopList({commit}){
    const result=await getHomeShopList();
    commit('setHomeShopList', result.message.goods_list)
  },

  //2.1获取推荐商品列表
  async reqRecommendShopList({commit}){
    const result=await getRecommendShopList();
    commit('setRecommendShopList', result.message)
  },

  //3.1获取搜索商品列表
  async reqSearchShopList({commit}){
    const result=await getSearchShopList();
    commit('setSearchShopList', result.message.data)
  }
}
